// 自动生成模板LevelTwo
package hierarchy

import (
	"gitcode.com/G-YT/ANN/server/global"
)

// LevelTwo 结构体
type LevelTwo struct {
	global.GVA_MODEL
	Key         string       `json:"key" form:"key" gorm:"column:key;comment:唯一标识;"`
	Value       string       `json:"value" form:"value" gorm:"column:value;comment:展示名称;"`
	LevelOneID  uint         `json:"levelOneID" form:"levelOneID" gorm:"column:level_one_id;comment:一级ID;"`
	LevelThrees []LevelThree `json:"levelThrees" form:"levelThrees" gorm:"foreignKey:LevelTwoID;references:ID;comment:三级;"`
}

type LevelTwoWithArt struct {
	global.GVA_MODEL
	Key        string             `json:"key" form:"key" gorm:"column:key;comment:唯一标识;"`
	Value      string             `json:"value" form:"value" gorm:"column:value;comment:展示名称;"`
	LevelOneID uint               `json:"levelTwoID" form:"levelTwoID" gorm:"column:level_two_id;comment:二级ID;"`
	Graphics   []FdArticleGraphic `json:"articles" form:"articles" gorm:"foreignKey:LevelThreeID;references:ID;comment:;"`
	Audios     []FdArticleAudio   `json:"audios" form:"audios" gorm:"foreignKey:LevelTwoID;references:ID;comment:;"`
	Videos     []FdArticleVideo   `json:"videos" form:"videos" gorm:"foreignKey:LevelTwoID;references:ID;comment:;"`
}

// TableName LevelTwo 表名
func (LevelTwo) TableName() string {
	return "level_two"
}
